<script lang="ts" setup>
import {ref, watch} from 'vue'


const x = ref(0)
let wo = {immediate: true, once: true}

watch(x, (newValue, oldValue) => {
  console.log('watch()开始')
  console.log(newValue)
  console.log(oldValue)
  console.log('watch()结束')
}, {})


</script>
<template>
  <button @click.once="x++">x++ x={{ x }} 一次性按钮</button>
  <button @click="x++">x++ x={{ x }}</button>
</template>
